import { createContext } from "react";

export const reducer = (state, action) => {
  switch (action.type) {
    case "add":
      return {
        count: state.count++,
      };
    case "minus":
      return {
        count: state.count--,
      };
    default:
      break;
  }
};

export const initialState = {
  count: 0,
};

export const globalContext = createContext(null);
export const globalDispatchContext = createContext(null);
